/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainFrame.java
 *
 * Created on Jun 13, 2012, 2:37:04 PM
 */
package com.ebdesk.view;

import com.ebdesk.controller.masterdata.UserManagement;
import com.ebdesk.model.masterdata.Session;
import com.ebdesk.view.about.AboutInternalFrame;
import com.ebdesk.view.dhkp.DHKPInternalFrame;
import com.ebdesk.view.masterdata.LoginUI;
import com.ebdesk.view.masterdata.PrinterManagementInternalFrame;
import com.ebdesk.view.masterdata.UserManagementInternalFrame;
import com.ebdesk.view.setting.SettingInternalFrame;
import com.ebdesk.view.sppt.SPPTInternalFrame;
import java.awt.Frame;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyVetoException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.*;

/**
 *
 * @author Acer
 */
public class MainFrame extends javax.swing.JFrame {
    
    
    private PrinterManagementInternalFrame internalFramePrinter;
    private UserManagementInternalFrame internalFrameUser;
    private DHKPInternalFrame internalFrameDHKP; 
    private SPPTInternalFrame internalFrameSPPT;
    private JInternalFrame internalFrameSetting;
    private JInternalFrame internalFrameAbout;
    private Session session;
    private Image imageFrame;
    /** Creates new form MainFrame */
    public MainFrame(Session session) /*throws PropertyVetoException */{
                try {
                        // Set System L&F
                    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
                } 
                catch (UnsupportedLookAndFeelException e) {
                   // handle exception
                }
                
                catch (ClassNotFoundException e) {
                   // handle exception
                }
                catch (InstantiationException e) {
                   // handle exception
                }
                catch (IllegalAccessException e) {
                   // handle exception
                }
        imageFrame = getImg();
        this.session = session;
        setExtendedState(JFrame.MAXIMIZED_BOTH);
        initComponents();
        this.labelSession.setText(session.getUser().getUsername() + "  ");
        
        final DateFormat timeFormat = new SimpleDateFormat("  dd/MM/yyyy - HH:mm:ss ");  
        ActionListener timerListener = new ActionListener()  
        {  
            @Override
            public void actionPerformed(ActionEvent e)  
            {  
                Date date = new Date();  
                String time = timeFormat.format(date);  
                labelTime.setText(time);  
            }  
        };  
        Timer timer = new Timer(1000, timerListener);  
        // to make sure it doesn't wait one second at the start  
        timer.setInitialDelay(0);  
        timer.start(); 
        
        internalFramePrinter = new PrinterManagementInternalFrame(this);
            this.internalFramePrinter.setClosable(true);
            this.internalFramePrinter.setIconifiable(true);
            this.internalFramePrinter.setMaximizable(true);
            this.internalFramePrinter.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
            this.internalFramePrinter.setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/com/ebdesk/view/images/lambang_small.jpg")));
            
        internalFrameUser = new UserManagementInternalFrame(this);
            this.internalFrameUser.setClosable(true);
            this.internalFrameUser.setIconifiable(true);
            this.internalFrameUser.setMaximizable(true);
            this.internalFrameUser.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
            this.internalFrameUser.setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/com/ebdesk/view/images/lambang_small.jpg")));
       
        internalFrameDHKP = new DHKPInternalFrame(this);
            this.internalFrameDHKP.setClosable(true);
            this.internalFrameDHKP.setIconifiable(true);
            this.internalFrameDHKP.setMaximizable(true);
            this.internalFrameDHKP.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
            this.internalFrameDHKP.setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/com/ebdesk/view/images/lambang_small.jpg")));
        
        internalFrameSPPT = new SPPTInternalFrame(this);
            this.internalFrameSPPT.setClosable(true);   
            this.internalFrameSPPT.setIconifiable(true);
            this.internalFrameSPPT.setMaximizable(true);
            this.internalFrameSPPT.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
            this.internalFrameSPPT.setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/com/ebdesk/view/images/lambang_small.jpg")));
         
        internalFrameSetting = new SettingInternalFrame();
            this.internalFrameSetting.setClosable(true);
            this.internalFrameSetting.setIconifiable(true);
            this.internalFrameSetting.setMaximizable(true);
            this.internalFrameSetting.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
            this.internalFrameSetting.setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/com/ebdesk/view/images/lambang_small.jpg")));
         
        internalFrameAbout = new AboutInternalFrame();
            this.internalFrameAbout.setClosable(true);
            this.internalFrameAbout.setIconifiable(true);
            //this.internalFrameAbout.setMaximizable(false);
            this.internalFrameAbout.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
            this.internalFrameAbout.setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/com/ebdesk/view/images/lambang_small.jpg")));
       
        if (this.session.getUser().getUser_type() != this.session.getUser().ADMIN)
            this.menuMasterData.setVisible(false);

        if (!desktopPane.isAncestorOf(this.internalFrameSPPT))
            desktopPane.add(this.internalFrameSPPT, javax.swing.JLayeredPane.DEFAULT_LAYER);
        if (!this.internalFrameSPPT.isVisible()){
            this.internalFrameSPPT.setVisible(true);

            try{
                this.internalFrameSPPT.setMaximum(true);
            }
            catch(PropertyVetoException e){
            }            
        }
        
        desktopPane.setSelectedFrame(this.internalFrameSPPT);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();
        panelBottom = new javax.swing.JPanel();
        toolBarBottom = new javax.swing.JToolBar();
        labelSession = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JToolBar.Separator();
        labelTime = new javax.swing.JLabel();
        panelContent = new javax.swing.JPanel();
        desktopPane = new javax.swing.JDesktopPane();
        menuBar = new javax.swing.JMenuBar();
        menuFile = new javax.swing.JMenu();
        menuLogout = new javax.swing.JMenuItem();
        menuExit = new javax.swing.JMenuItem();
        menuMasterData = new javax.swing.JMenu();
        menuPrinterManagement = new javax.swing.JMenuItem();
        menuUserManagement = new javax.swing.JMenuItem();
        menuReport = new javax.swing.JMenu();
        menuSPPT = new javax.swing.JMenuItem();
        menuDHKP = new javax.swing.JMenuItem();
        menuTools = new javax.swing.JMenu();
        menuItemSetting = new javax.swing.JMenuItem();
        menuHelp = new javax.swing.JMenu();
        menuAbout = new javax.swing.JMenuItem();

        jMenuItem1.setText("jMenuItem1");

        jMenu1.setText("File");
        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");
        jMenuBar1.add(jMenu2);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Aplikasi Print SPPT");
        setIconImage(imageFrame);
        setName("mainFrame"); // NOI18N

        toolBarBottom.setFloatable(false);
        toolBarBottom.setRollover(true);

        labelSession.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        labelSession.setText("Session");
        toolBarBottom.add(labelSession);
        toolBarBottom.add(jSeparator1);

        labelTime.setText("  DD-MM-YYYY  ");
        toolBarBottom.add(labelTime);

        javax.swing.GroupLayout panelBottomLayout = new javax.swing.GroupLayout(panelBottom);
        panelBottom.setLayout(panelBottomLayout);
        panelBottomLayout.setHorizontalGroup(
            panelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBottomLayout.createSequentialGroup()
                .addComponent(toolBarBottom, javax.swing.GroupLayout.DEFAULT_SIZE, 204, Short.MAX_VALUE)
                .addGap(875, 875, 875))
        );
        panelBottomLayout.setVerticalGroup(
            panelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBottomLayout.createSequentialGroup()
                .addComponent(toolBarBottom, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 1, Short.MAX_VALUE))
        );

        panelContent.setBackground(new java.awt.Color(255, 255, 255));
        panelContent.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        desktopPane.setBackground(new java.awt.Color(204, 204, 255));
        desktopPane.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        javax.swing.GroupLayout panelContentLayout = new javax.swing.GroupLayout(panelContent);
        panelContent.setLayout(panelContentLayout);
        panelContentLayout.setHorizontalGroup(
            panelContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(desktopPane)
        );
        panelContentLayout.setVerticalGroup(
            panelContentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 479, Short.MAX_VALUE)
        );

        menuFile.setText("File");

        menuLogout.setBackground(new java.awt.Color(236, 233, 216));
        menuLogout.setText("Log Out");
        menuLogout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuLogoutActionPerformed(evt);
            }
        });
        menuFile.add(menuLogout);

        menuExit.setBackground(new java.awt.Color(236, 233, 216));
        menuExit.setText("Exit");
        menuExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuExitActionPerformed(evt);
            }
        });
        menuFile.add(menuExit);

        menuBar.add(menuFile);

        menuMasterData.setText("MasterData");

        menuPrinterManagement.setBackground(new java.awt.Color(236, 233, 216));
        menuPrinterManagement.setText("Printer Management");
        menuPrinterManagement.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuPrinterManagementActionPerformed(evt);
            }
        });
        menuMasterData.add(menuPrinterManagement);

        menuUserManagement.setBackground(new java.awt.Color(236, 233, 216));
        menuUserManagement.setText("User Management");
        menuUserManagement.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuUserManagementActionPerformed(evt);
            }
        });
        menuMasterData.add(menuUserManagement);

        menuBar.add(menuMasterData);

        menuReport.setText("Report");

        menuSPPT.setBackground(new java.awt.Color(236, 233, 216));
        menuSPPT.setText("SPPT");
        menuSPPT.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuSPPTActionPerformed(evt);
            }
        });
        menuReport.add(menuSPPT);

        menuDHKP.setBackground(new java.awt.Color(236, 233, 216));
        menuDHKP.setText("DHKP");
        menuDHKP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuDHKPActionPerformed(evt);
            }
        });
        menuReport.add(menuDHKP);

        menuBar.add(menuReport);

        menuTools.setText("Tools");

        menuItemSetting.setBackground(new java.awt.Color(236, 233, 216));
        menuItemSetting.setText("Setting");
        menuItemSetting.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuItemSettingActionPerformed(evt);
            }
        });
        menuTools.add(menuItemSetting);

        menuBar.add(menuTools);

        menuHelp.setText("Help");

        menuAbout.setBackground(new java.awt.Color(236, 233, 216));
        menuAbout.setText("About Aplikasi Print SPPT");
        menuAbout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuAboutActionPerformed(evt);
            }
        });
        menuHelp.add(menuAbout);

        menuBar.add(menuHelp);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelBottom, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(panelContent, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(panelContent, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelBottom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void menuPrinterManagementActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuPrinterManagementActionPerformed
        if (!desktopPane.isAncestorOf(this.internalFramePrinter))
            desktopPane.add(this.internalFramePrinter, javax.swing.JLayeredPane.DEFAULT_LAYER);    
        
        if (!this.internalFramePrinter.isVisible())
            this.internalFramePrinter.setVisible(true);
        
        desktopPane.setSelectedFrame(this.internalFramePrinter);    
    }//GEN-LAST:event_menuPrinterManagementActionPerformed

    private void menuUserManagementActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuUserManagementActionPerformed
        if (!desktopPane.isAncestorOf(this.internalFrameUser))
            desktopPane.add(this.internalFrameUser, javax.swing.JLayeredPane.DEFAULT_LAYER);    
        if (!this.internalFrameUser.isVisible())
            this.internalFrameUser.setVisible(true);
        
        desktopPane.setSelectedFrame(this.internalFrameUser);
    }//GEN-LAST:event_menuUserManagementActionPerformed

    private void menuDHKPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuDHKPActionPerformed
        if (!desktopPane.isAncestorOf(this.internalFrameDHKP))
            desktopPane.add(this.internalFrameDHKP, javax.swing.JLayeredPane.DEFAULT_LAYER);
        if (!this.internalFrameDHKP.isVisible()){
            this.internalFrameDHKP.setVisible(true);

            try{
                this.internalFrameDHKP.setMaximum(true);
            }
            catch(PropertyVetoException e){
            }            
        }
        
        desktopPane.setSelectedFrame(this.internalFrameDHKP);
    }//GEN-LAST:event_menuDHKPActionPerformed

    private void menuExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuExitActionPerformed
        int exit = JOptionPane.showOptionDialog(rootPane, "Are you sure to quit application?","Quit Application" , 
                                                JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
        if(exit == JOptionPane.YES_OPTION){
            this.session.setStopTime(new Date());
            System.exit(0);
        }
    }//GEN-LAST:event_menuExitActionPerformed

    private void menuLogoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuLogoutActionPerformed
        int logout = JOptionPane.showOptionDialog(rootPane, "Are you sure to logout?","Logout Application" , 
                                                    JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
        if(logout == JOptionPane.YES_OPTION){
            this.session.setStopTime(new Date());
            this.setVisible(false);
            new LoginUI().setVisible(true);
        }
    }//GEN-LAST:event_menuLogoutActionPerformed

    private void menuSPPTActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuSPPTActionPerformed
        // TODO add your handling code here:
        if (!desktopPane.isAncestorOf(this.internalFrameSPPT))
            desktopPane.add(this.internalFrameSPPT, javax.swing.JLayeredPane.DEFAULT_LAYER);
        if (!this.internalFrameSPPT.isVisible()){
            this.internalFrameSPPT.setVisible(true);

            try{
                this.internalFrameSPPT.setMaximum(true);
            }
            catch(PropertyVetoException e){
            }            
        }

        desktopPane.setSelectedFrame(this.internalFrameSPPT);
    }//GEN-LAST:event_menuSPPTActionPerformed

    private void menuItemSettingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuItemSettingActionPerformed
        if (!desktopPane.isAncestorOf(this.internalFrameSetting))
            desktopPane.add(this.internalFrameSetting, javax.swing.JLayeredPane.DEFAULT_LAYER);
        if (!this.internalFrameSetting.isVisible())
            this.internalFrameSetting.setVisible(true);
        desktopPane.setSelectedFrame(this.internalFrameSetting);
    }//GEN-LAST:event_menuItemSettingActionPerformed

    private void menuAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuAboutActionPerformed
        // TODO add your handling code here:
        if (!desktopPane.isAncestorOf(this.internalFrameAbout))
            desktopPane.add(this.internalFrameAbout, javax.swing.JLayeredPane.DEFAULT_LAYER);
        if (!this.internalFrameAbout.isVisible())
            this.internalFrameAbout.setVisible(true);
        desktopPane.setSelectedFrame(this.internalFrameAbout);
    }//GEN-LAST:event_menuAboutActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                try {
                    new MainFrame(new Session(new UserManagement().getUser("jol"))).setVisible(true);
                } catch (Exception ex) {
                
                }
                     
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane desktopPane;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JToolBar.Separator jSeparator1;
    private javax.swing.JLabel labelSession;
    private javax.swing.JLabel labelTime;
    private javax.swing.JMenuItem menuAbout;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenuItem menuDHKP;
    private javax.swing.JMenuItem menuExit;
    private javax.swing.JMenu menuFile;
    private javax.swing.JMenu menuHelp;
    private javax.swing.JMenuItem menuItemSetting;
    private javax.swing.JMenuItem menuLogout;
    private javax.swing.JMenu menuMasterData;
    private javax.swing.JMenuItem menuPrinterManagement;
    private javax.swing.JMenu menuReport;
    private javax.swing.JMenuItem menuSPPT;
    private javax.swing.JMenu menuTools;
    private javax.swing.JMenuItem menuUserManagement;
    private javax.swing.JPanel panelBottom;
    private javax.swing.JPanel panelContent;
    private javax.swing.JToolBar toolBarBottom;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the session
     */
    public Session getSession() {
        return session;
    }
    public String getTahun(){
        String tahun = internalFrameDHKP.getTfTahun().getText();
        return tahun;
    }
    public String getKecamatan(){
        String camat = (String)internalFrameDHKP.getComboBoxKecamatan().getSelectedItem(); 
        return camat;  
    }
    public String getKelurahan(){
        String lurah = (String)internalFrameDHKP.getComboBoxKelurahan().getSelectedItem();
        return lurah;
    }
   
    public String getKelompokBuku(){
        String kelBuku = (String)internalFrameDHKP.getComboBoxBuku().getSelectedItem();
        return kelBuku;
    }
    public int getIndexBuku(){
        int idxBuku = internalFrameDHKP.getComboBoxBuku().getSelectedIndex();
        return idxBuku;
    }
    public int getCountBuku(){
        int countBuku = internalFrameDHKP.getComboBoxBuku().getItemCount();
        return countBuku;
    }
    public String getNOP(){
        String nop = (String)internalFrameDHKP.getTabelDHKP().getValueAt(0, 0);
        return nop;
    }
     public void PrintAllPage() throws Exception {
         internalFrameDHKP.PrintAllPage();       
    }
    public void PrintOnePage() throws Exception{
        internalFrameDHKP.PrintOnePage();
    }
    public void PrintCustomPage() throws Exception{
        internalFrameDHKP.PrintCustomPage();
    }
    public void PrintCover() throws Exception{
        internalFrameDHKP.PrintCover();
    }
    public void PrintKetetapan() throws Exception{
        internalFrameDHKP.PrintKetetapan();
    }
    public int noHal() throws Exception{
        return internalFrameDHKP.noHal();
    }
    public void PrintFromFirstPage() throws Exception{
        internalFrameDHKP.PrintFromFirstPage();
    }
    public void PrintToLastPage() throws Exception{
        internalFrameDHKP.PrintToLastPage();
    }
    private static Image getImg(){
        java.net.URL ImgURL = Frame.class.getResource("/com/ebdesk/view/images/lambang_small.jpg");
        if(ImgURL != null){
            return new ImageIcon(ImgURL).getImage();
        }else{
            return null;
        }
    }
}
